<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>登陆</title>
  <style>
    #form-wrap {
      width: 40%;
      margin: 20px auto;
    }

    button,
    select,
    input {
      padding: 10px 20px;
      width: 100%;
      box-sizing: border-box;
      border: 1px solid #ccc;
    }

    .input-wrap {
      margin-bottom: 20px;
    }

    .input-wrap:after {
      content: ' ';
      clear: both;
      display: block;
    }

    .left {
      padding-top: 10px;
      float: left;
      width: 20%;
    }

    .right {
      float: left;
      width: 80%;
    }
  </style>
</head>

<body>
  <div id="form-wrap">
    <form id="form" action="/login/login">
      <div class="input-wrap">
        <div class="left">社会统一信用代码:</div>
        <div class="right">
          <input type="text" placeholder="证件类型" id="tyshxydm" name="tyshxydm" value="9111010574470043X2">
        </div>
      </div>
      <div class="input-wrap">
          <div class="left">单位名称:</div>
          <div class="right">
            <input type="text" placeholder="单位名称" id="dwmc" name="dwmc" value="">
          </div>
        </div>
      <button type="button" id="btnLogin">登陆</button>
    </form>
  </div>
	<script src="./common/js/vendor.js"></script>
  <script>
    $(function() {
      $('#btnLogin').click(function(event) {
        event.preventDefault(); //阻止默认行为 防止链接打开 URL
        $.ajax({
          type: 'post',
          url: '/login/dwcslogin',
          data: JSON.stringify({
            tyshxydm: $('#tyshxydm').val(),
            dwmc: $('#dwmc').val()
          })
        }).done(function(result) {
          if (result.returnCode == '1') {
            window.location.href = './index.html';
          }
        });
      });
    });
  </script>
</body>

</html>